<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<link href="css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">					<!-- zTree CSS函式庫 -->
<link href="css/redmond/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css">	<!-- jquery UI CSS函式庫 -->
<link href="css/selfTemplate.css" rel="stylesheet" type="text/css">							<!-- 自建CSS函式庫 -->
					
<script src="js/jquery-1.10.2.min.js" type="text/javascript"></script>								<!-- jquery 函式庫 -->
<script src="js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>					<!-- jquery UI 函式庫 -->
<script src="js/jquery.cookie.js" type="text/javascript"></script>								<!-- 操做cookie用 -->
<script src="js/widgets.js" type="text/javascript"></script>									<!-- 自建函式庫 -->

<script type="text/javascript">

function reBE(obj) {
	var chkInMainId = $(obj).attr("chkInMainId");
	var subsysId = $(obj).attr("subsysId");
	var cmFileVer = $(obj).attr("cmFileVer");
	var empId = $.cookie("empId");

	$.ajax({ type:'post',url:"TriggerRecovery",dataType:'text',async:false,
		data: {chkInMainId:chkInMainId,subsysId:subsysId,cmFileVer:cmFileVer,empId:empId},
		success : function(res) {
			console.log(res);
		}, error : function(xhr, ajaxOptions, thrownError) { errorAjx(xhr); }
	});
}

$(document).ready(function(){
	
	init("beRecovery.html");
	
	$.ajax({ type:'post',url:"QueryBeFailure",dataType:'json',async:false,
		data: {queryRowLimitedNumber:10},
		success : function(reses) {
			$.each(reses, function(i,res) {
				var tmp = "<tr><td class='center'><button onclick='reBE(this)' type='button' chkInMainId='"+res.chkInMainId+"' subsysId='"+res.subsysId+"' cmFileVer='"+res.cmFileVer+"'>重新執行</button></td><td class='int'>"+(i+1)+"</td><td>"+res.subsysDesc+"("+res.subsysId+")</td><td class='center'>"+(res.isUrgent?"是":"否")+"</td><td class='center'>"+(res.isDailyBuild?"是":"否") +"</td><td class='int'>"+res.chkInMainId+"</td><td class='int'>"+res.cmFileVer+"</td><td>"+res.empName+"</td><td>"+res.cDT+"</td></tr>";
				$("#tbodyBeFailure").append(tmp);				
			});
			refreshUI(1,"tbodyBeFailure",false);
		}, error : function(xhr, ajaxOptions, thrownError) { errorAjx(xhr); }
	});
	
	$("button").button();
});

</script>
</head>
<body>
	<div id="header"></div>		<!-- 畫面抬頭 -->

	<table id="tableBeFailure">
		<thead class="tableFirst">
			<tr><th>&nbsp;</th><th>#</th><th>子系統</th><th>緊急上線?</th><th>例行性</th><th>繳交序號</th><th>CM OL版次</th><th>繳交人員</th><th>發生時間</th></tr>
		</thead>
		<tbody id="tbodyBeFailure"></tbody>
	</table>
</body>



<!-- 單純確認的對話框 -->
<div class="dialog" id="diaConfirm"></div>

</html>